﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UniversityExample
{
    class Faculty
    {
        public string NameOfFaculty;
        List<DepartmentList> DepartmentsOfFaculty = new List<DepartmentList>();
        public void AddDepartmentToFaculty()
        {
            string choise;
            Console.WriteLine("Введите название факультета");
            NameOfFaculty = Console.ReadLine();
            do
            {
                DepartmentList EveryDepartment = new DepartmentList();
                EveryDepartment.AddGroupToDepartment();
                DepartmentsOfFaculty.Add(EveryDepartment);
                Console.WriteLine("Желаете добавить еще кафедру? Д/Н");
                choise = Console.ReadLine();
            }
            while (choise == "Д" || choise == "д");
        }
            public void ShowListOfFaculty()
        {
            Console.WriteLine("На {0} факультете есть такие кафедры:", NameOfFaculty);
            foreach (var faculty in DepartmentsOfFaculty)
            {
                faculty.ShowListOfDepartment();
            }
        }
        public void CertainDepartmentInFaculty()
        {
            Console.WriteLine("Список какой кафедры хотите вывести?");
            string NameOfChosenDepartment = Console.ReadLine();
            bool isDepartmentExist = false;
            foreach (var CertainDepartment in DepartmentsOfFaculty)
            {
                if (CertainDepartment.NameOfDepartment == NameOfChosenDepartment)
                {
                    CertainDepartment.ShowListOfDepartmentWithoutMarks();
                    isDepartmentExist = true;
                }
                if (!isDepartmentExist)
                {
                    Console.WriteLine("Такой каферы нет!");
                }
            }
        }
    }
}
